package Java0309;

import java.util.Scanner;

public class Huiwen {
    public static void main(String[] args) {
        //要求：输入一个整数，判断其是否是回文数，回文数是指这个数颠倒后，和原数相同那个
        //存储转换后的数字
        int sum = 0;
        //存储number的值
        int newNumber = 0;
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入一个整数：");
        int number = scan.nextInt();
        newNumber = number;
        while (number != 0) {
            sum = (sum * 10) + number % 10;
            number = number / 10;
        }
        if (sum == newNumber) {
            System.out.println(newNumber + "是回文数！");
        } else {
            System.out.println(newNumber + "不是回文数！");
        }
    }
}
